{% extends 'base.html' %}

{% block breadcrumb_current %}
    超级管理员 > 地市管理
{% endblock %}

{% block content %}
    {% if messages %}
        {% for message in messages %}
            <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
                {{ message }}
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        {% endfor %}
    {% endif %}
    
    <div class="bg-light p-3 shadow-sm">
        <h5 style="color: #417690;">
            地市管理
            <a href="{% url 'navigation' %}" class="btn btn-secondary btn-sm float-end" style="margin-left: 15px;">返 回</a>
            <a href="{% url 'supercompany_add' %}" class="btn btn-secondary btn-sm float-end">新增地市</a>
        </h5>
    </div>

<div class="container mt-4">
    <table class="table table-hover" style="margin-top: 15px;">
        <thead>
            <tr>
                <th>地市名称</th>
                <th><i class="fa-solid fa-pen-to-square me-2"></i>编辑</th>
                <th><i class="fa-solid fa-trash-can"></i>删除</th>
            </tr>
        </thead>
        <tbody>
            {% for company in companies %}
            <tr class="custom-row-color">
                <td>{{ company.company }}</td>
                <td><a href="{% url 'feature_not_available' %}" class="text-info text-decoration-none">编辑</a></td>
                <td><a href="{% url 'feature_not_available' %}" class="text-info text-decoration-none"  onclick="return confirm('确定要删除{{company.company}}吗？')">删除</a></td>
            </tr>
            {% empty %}
            <tr>
                <td colspan="4" class="text-center">暂无地市数据</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}